#include <stdio.h>
int main()
{
    int n, letter = 0, blank = 0, digit = 0;
    char c;
    scanf("%d", &n);
    getchar();
    for(int i = 1; i <= n; i++)
    {
        c = getchar();
        if(c == '\n' || c == ' ') blank++;
        if(('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')) letter++;
        if('0' <= c && c <= '9') digit++;
    }
    printf("letter = %d, blank = %d, digit = %d, other = %d", letter, blank, digit, n - letter - blank - digit);
    return 0;
}